//
//  CellTwoTab2.m
//  project-A (pianke)
//
//  Created by dllo on 16/1/27.
//  Copyright © 2016年 scott. All rights reserved.
//

#import "CellTwoTab2.h"
#import <DKNightVersion.h>
@implementation CellTwoTab2
-(void)dealloc{
    
    [_title release];
    
    [_desc release];
    [_xianview release];
    [_image3 release];
    [_image2 release];
    [_image release];
    
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatview];
    }
    
    return self;
}

-(void)creatview{
    self.title = [[UILabel alloc]init];
    [self.contentView addSubview:self.title];
    self.title.font = [UIFont fontWithName:@"AmericanTypewriter-Bold" size:20];
    self.title.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    [self.title release];
    
    self.desc  = [[UILabel alloc]init];
    [self.contentView addSubview:self.desc];
    self.desc.numberOfLines = 2;
   
     self.desc.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    self.desc.font = [UIFont systemFontOfSize:14];
    [self.desc release];
    
    self.image = [[UIImageView alloc]init];
    [self.contentView addSubview:self.image];
    [self.image release];
    
    self.image2 = [[UIImageView alloc]init];
    [self.contentView addSubview:self.image2];
    self.image2.image = [UIImage imageNamed:@"bofang"];
    [self.image2 release];
    
    self.time = [[UILabel alloc]init];
    [self.contentView addSubview:self.time];
    self.time.font = [UIFont systemFontOfSize:10];
    
     self.time.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    [self.time release];
    
    self.image3 = [[UIImageView alloc]init];
    [self.contentView addSubview:self.image3];
//    self.image3.image = [UIImage imageNamed:@"hot2"];
//    self.image3.hidden = NO;
    [self.image3 release];

    self.xianview  = [[UIView alloc]init];
    [self.contentView addSubview:self.xianview];
    self.xianview.backgroundColor = [UIColor lightGrayColor];
   
    [self.xianview release];
}
-(void)layoutSubviews{
    
    [super layoutSubviews];
    CGFloat width = self.contentView.frame.size.width;
    
    self.title.frame = CGRectMake(30 + width * 0.3, 20, 0.6 * width, 30);
    self.desc.frame = CGRectMake(30 + width * 0.3, 65, width * 0.6, 40);
    self.image.frame = CGRectMake(15, 15, width * 0.3,width *0.225);

    self.image2.frame = CGRectMake(0, 0, 40, 40);
    self.image2.center = CGPointMake((width * 0.3)/2 + 15, (width *0.225)/2 + 15);
    
    self.image3.hidden = NO;
    self.image3.frame = CGRectMake(width - 50, 20, 35, 25);

   self.time.frame = CGRectMake(0.82 *width, 0.25 *width, 0.15 *width, 15);
    self.xianview.frame = CGRectMake(15, 0.225 * width +29, width - 30, 1);
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
